package com.example.report

import com.example.lib_base.BaseRepo
import com.example.lib_base.Res
import com.example.lib_http.HttpType
import com.example.lib_http.NetworkFactory
import kotlinx.coroutines.flow.Flow
import javax.inject.Inject

class ReportRepo @Inject constructor() : BaseRepo() {
    //private val apiService by lazy { NetworkFactory.factory(HttpType.NONE).create(ApiService::class.java) }
    private val apiService by lazy { NetworkFactory.factory(HttpType.TOKEN).create(ApiService::class.java) }
    fun getReports(): Flow<Res<ReportEntity>> {
        return apiService.getReports()
    }


    fun addReport(map: Map<String, String>): Flow<Res<Any>> {
        return apiService.addReport(mapToJson(map))
    }
}